package com.example.demo.utils;

import java.util.UUID;

public class UUIDGenerator {
    // 生成32位的UUID字符串
    public static String generate32BitUUID() {
        // 生成一个随机的UUID
        UUID uuid = UUID.randomUUID();
        // 将UUID转换为字符串并移除所有连字符
        String uuidStr = uuid.toString().replace("-", "");
        return uuidStr;
    }

    public static void main(String[] args) {
        // 测试生成的UUID
        System.out.println(generate32BitUUID());
        System.out.println(generate32BitUUID());

    }
}
